package array

func getRow(rowIndex int) []int {
	if rowIndex == 0 {
		return []int{1}
	} else if rowIndex == 1 {
		return []int{1, 1}
	}

	res := make([]int, rowIndex+1)
	last := getRow(rowIndex - 1)
	res[0] = 1
	for i := 1; i < rowIndex; i++ {
		res[i] = last[i] + last[i-1]
	}
	res[rowIndex] = 1

	return res

}
